<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<title>FLDCMS后台管理系统</title>
<meta name="keywords" content="FLDCMS，FLDCMS后台管理系统">
<meta name="description" content="FLDCMS，是一款由FLD开发的轻量级扁平化网站后台模板，适合中小型CMS后台系统。">
{include file="public/header" /}
<style>
	img[nc_type="flex"]{cursor:pointer;}
</style>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页
	{notempty name="$node_info.p_title"}
	<span class="c-gray en">&gt;</span>
		{$node_info.p_title}
	{/notempty}
	{notempty name="$node_info.node_title"}
	<span class="c-gray en">&gt;</span>
		{$node_info.node_title}
	{/notempty}
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
		<i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>
<div class="page-container">
	{containstr name=":session('act_list')" value="Article_add"}
	<div class="cl pd-5 bg-1 bk-gray">
		<span class="l">
			<a class="btn btn-primary radius" data-title="添加文章" onclick="layer_open('添加文章','{:url('Article/add')}')" href="javascript:;">
				<i class="Hui-iconfont"></i> 添加文章
			</a>
		</span>
	</div>
	{/containstr}
	<div id="tab-system" class="HuiTab">
		<div class="text-l cl pd-10">
			<form name="search-form" id="search-form" method="post" action="{:url('Article/index')}">
				<label class="search_label">关键字：</label>
				<input type="text" name="keyword" id="keyword" placeholder=" 关键字" class="input-text w150" value="{$keyword}">
				<label class="search_label">所属分类：</label>
				<span class="select-box radius w100">
					<select name="class_id" class="select valid">
						<option value="">请选择</option>
						{foreach name="cate_list" item="cvo"}
						<option value="{$cvo.id}"
							{if $class_id eq $cvo['id']}selected{/if}
						>{$cvo.cate_name}</option>
						{/foreach}
					</select>
				</span>
				<button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
			</form>
		</div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort" id="table_menu">
				<thead>
					<tr class="text-c">
						<th width="30">编号</th>
						<th width="150">文章标题</th>
						<th width="60">所属分类</th>
						<th width="60">作者</th>
						<th width="60">是否显示</th>
						<th width="60">是否置顶</th>
						<th width="60">点击数</th>
						<th width="60">更新时间</th>
						<th width="80">操作</th>
					</tr>
				</thead>
				<tbody>
					{notempty name="list"}
					{foreach name="list" item="vo"}
					<tr class="text-c">
						<td class="text-c">{$vo.id}</td>
						<td class="text-c">{$vo.article_title}</td>
						<td class="text-c">{:getTable('cate','id='.$vo['class_id'],'cate_name')}</td>
						<td class="text-c">{$vo.article_author}</td>
						<td class="text-c">{:getStatus('is_show',$vo["is_show"])}</td>
						<td class="text-c">{:getStatus('is_top',$vo["is_top"])}</td>
						<td class="text-c">{$vo.click}</td>
						<td class="text-c">{$vo.update_time|date="Y-m-d H:i:s",###}</td>
						<td class="text-c">
							{containstr name=":session('act_list')" value="Article_edit"}
							<a style="text-decoration:none" class="ml-5" onclick="layer_open('编辑文章','{:Url('/Article/edit/id/'.$vo['id'])}')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> 
							{/containstr}
							{containstr name=":session('act_list')" value="Article_delete"}
							<a style="text-decoration:none" class="ml-5" onClick="table_del(this,'{$vo.id}')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
							{/containstr}
						</td>
					</tr>
					{/foreach}
					{/notempty}
					{empty name="list"}
						<tr class="no_data">
							<td class="text-c" colspan="9">
								没有符合条件的记录
							</td>
						</tr>
					{/empty}
				</tbody>
			</table>
		</div>
		<div class="pager">
			{$page}	
		</div>
	</div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
/*删除*/
function table_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({  
            type : "POST",  //提交方式  
            url : "{:url('Article/delete')}",//路径  
            data : { "id" : id },
            async:false, 
            success : function(result) {
                if (result.error == 0) {  
                	$(obj).parents("tr").remove();
                	location.reload();
            		layer.msg('删除成功!',{icon:1,time:1000});
                } else { 
                    layer.msg('删除失败!',{icon:0,time:1000});
                }  
            },
            error: function (data) {
				alert("操作失败");
			}  
        }); 
	});
}
</script>
</body>
</html>